---
title: Configuration.handleMessage()
api: Configuration.handleMessage
---

## Description

<Summary/>

<FilterDiagram
  name="handleMessage"
  input="Event"
  output="Event"
/>

The user function that gets called will have a [Message](/reference/api/Message) object as parameter.

> A _Message_ object is not an event, but a convenient container for a series of events that compose a complete message, that is, starting with a [MessageStart](/reference/api/MessageStart) event, followed by one or more [Data](/reference/api/Data) events and ended by a [MessageEnd](/reference/api/MessageEnd) event.

This filter passes every input event down to its output. It doesn't change how many or what events there are. However, since events are all just objects being passed around by reference, if you alter the event object itself, the change will be visible on the output, even though the references to the events are identical between the input and the output.

## Syntax

``` js
pipy()
  .pipeline()
  .handleMessage(
    message => onMessage(message)
  )
```

## Parameters

<Parameters/>

## See Also

* [Configuration](/reference/api/Configuration)
* [handleData()](/reference/api/Configuration/handleData)
* [handleStreamStart()](/reference/api/Configuration/handleStreamStart)
* [handleStreamEnd()](/reference/api/Configuration/handleStreamEnd)
* [handleMessageStart()](/reference/api/Configuration/handleMessageStart)
* [handleMessageBody()](/reference/api/Configuration/handleMessageBody)
* [handleMessageEnd()](/reference/api/Configuration/handleMessageEnd)
